package com.mo.lib.view.gridview

import android.content.Context
import android.util.AttributeSet
import android.widget.GridView
import android.view.View.MeasureSpec

/**
 * author zaaach on 2015/1/26.
 */
class WrapHeightGridView @JvmOverloads constructor(context: Context?, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : GridView(context, attrs, defStyleAttr) {
    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val heightSpec = MeasureSpec.makeMeasureSpec(Int.MAX_VALUE shr 2, MeasureSpec.AT_MOST)
        super.onMeasure(widthMeasureSpec, heightSpec)
    }
}